<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:view contentType="text/html">
        <h:head>
            <title>
                <ui:insert name="title">#{i18n['application.name']}</ui:insert>
            </title>
            <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/themes/#{guestPreferences.theme}/skin.css" />
            <style type="text/css">
                .ui-widget {
                    font-size: 75%;
                }

                .themeMenu {
                    overflow: auto;
                    height:300px;
                    width:200px;
                }
                .customerService {
                    background-color: #000000;
                    font-size: 120%
                }
                .ui-datatable-header {
                    text-align: left !important;
                }
                }
            </style>
            <script type="text/javascript">
                        function handleChangePassowrdRequest(args) {
                                if(args.validationFailed || !args.success) {
                                        jQuery('#dialog').parent().effect("shake", { times:5 }, 100);
                                } else {
                                        dlg.hide();
                                }
                        }
            </script>
            <!-- JavaScript Dependencies for Tabview: -->
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/default.css" />

            <p:resource name="/jquery/jquery.js" />
            <p:resource name="/jquery/plugins/effects/effects.js" />

        </h:head>
        <h:body >
            <p:layout  fullPage="true">
                <p:layoutUnit  position="top" height="65" header="新天地婚纱影楼管理系统"      scrollable="null" resizable="true" proxyResize="true" zindex="100" >
                    <p:growl id="growl" showDetail="true" life="3000"></p:growl>
                    <!--                    <div id="demo" class=" ui-widget-header yui-navset">
                                            <ul class="yui-nav ">
                                                <li class="selected"><a href="/xtd-war/view/main.jsf">
                                                        <em>Tab One Label</em>
                                                        <f:setPropertyActionListener value="#{car}" target="#{tableBean.selectedCar}"/>
                                                    </a>
                                                </li>
                                                <li ><a href="/xtd-war/view/retail/main.jsf"><em>Tab Two Label</em></a></li>
                                                <li ><a href="#tab3"><em>Tab Three Label</em></a></li>
                                            </ul>
                                        </div>-->
                    <p:tabView>

                    </p:tabView>
                    <h:panelGroup  >
                        <h:form>
                            <p:commandButton value="我的首页" action ="/view/main" ajax="false" >  <f:setPropertyActionListener value="myHome" target="#{userRoleController.selectedTab}"/></p:commandButton>
                            <p:commandButton value="门市管理" action="/view/retail/main" ajax="false"><f:setPropertyActionListener value="retailHome" target="#{userRoleController.selectedTab}"/></p:commandButton>
                            <p:linkButton value="财务管理"  href="/xtd-war/view/main.jsf"></p:linkButton>
                            <p:linkButton value="库存管理"  href="/xtd-war/view/main.jsf"></p:linkButton>
                            <p:linkButton value="行政管理"  href="/xtd-war/view/main.jsf"></p:linkButton>
                            <p:linkButton value="客服管理" id="customerService"  href="/xtd-war/view/main.jsf"></p:linkButton>
                            <p:linkButton value="系统设置"  href="/xtd-war/view/main.jsf"></p:linkButton>
                        </h:form>

                        <h:form>
                            <h:panelGrid style="position: absolute; right: 10px ; top: 10px; font-size:110%" columns="2">
                                <p:commandLink value="退出" action="#{userRoleController.logout}" ajax="false"> </p:commandLink>
                                <p:commandLink value="修改密码" onclick="dlg.show()" ></p:commandLink>
                            </h:panelGrid>
                        </h:form>
                        <p:dialog id="dialog" header="Login" widgetVar="dlg"  modal="true" >
                            <h:form>
                                <h:panelGrid columns="2" cellpadding="5">
                                    <h:outputLabel for="oldPassword" value="旧密码: *" />
                                    <p:password value="#{loginBean.oldPassword}" minLength="1" id="oldPassword" required="true" />
                                    <h:outputLabel for="newPassword" value="新密码: *" />
                                    <p:password value="#{loginBean.newPassword}" minLength="1" id="newPassword" required="true" />
                                    <h:outputLabel for="confirmPassword" value="确认密码: *" />
                                    <p:password value="#{loginBean.confirmPassword}" minLength="1" id="confirmPassword" required="true" />
                                    <p:commandButton value="保存" update="growl"  actionListener="#{loginBean.changePassword}" oncomplete="handleChangePassowrdRequest(args)"/>
                                </h:panelGrid>
                            </h:form>
                        </p:dialog>
                    </h:panelGroup>


                </p:layoutUnit>

                <p:layoutUnit position="bottom" height="75" header="Bottom" resizable="true" closable="true" collapsible="true">
                    <h:outputText value="South unit content." />
                </p:layoutUnit>
                <p:layoutUnit position="left" width="200"  resizable="false" closable="false" collapsible="false">
                    <ui:insert name="navigation"></ui:insert>
                </p:layoutUnit>

                <p:layoutUnit position="right" width="200"  resizable="true" closable="true" collapsible="true">
                    <h:form>
                        <p:commandButton id="themeButton" value="Change Theme: #{guestPreferences.theme}" onclick="themeMenu.show()" type="button"/>
                        <p:menu widgetVar="themeMenu" position="dynamic" context="'themeForm:themeButton','tl','bl'" styleClass="themeMenu">
                            <p:submenu label="Themes">
                                <p:menuitem value="Sam (Default)" ajax="false"><f:setPropertyActionListener value="sam" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Base" ajax="false"><f:setPropertyActionListener value="base" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Black-Tie" ajax="false"><f:setPropertyActionListener value="black-tie" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Blitzer" ajax="false"><f:setPropertyActionListener value="blitzer" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Casablanca" ajax="false"><f:setPropertyActionListener value="casablanca" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Cupertino" ajax="false"><f:setPropertyActionListener value="cupertino" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Dark-Hive" ajax="false"><f:setPropertyActionListener value="dark-hive" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Dot-Luv" ajax="false"><f:setPropertyActionListener value="dot-luv" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Eggplant" ajax="false"><f:setPropertyActionListener value="eggplant" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Excite-Bike" ajax="false"><f:setPropertyActionListener value="excite-bike" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Flick" ajax="false"><f:setPropertyActionListener value="flick" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Hot-Sneaks" ajax="false"><f:setPropertyActionListener value="hot-sneaks" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Humanity" ajax="false"><f:setPropertyActionListener value="humanity" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Le-Frog" ajax="false"><f:setPropertyActionListener value="le-frog" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Mint-Choc" ajax="false"><f:setPropertyActionListener value="mint-choc" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Overcast" ajax="false"><f:setPropertyActionListener value="overcast" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Pepper-Grinder" ajax="false"><f:setPropertyActionListener value="pepper-grinder" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Redmond" ajax="false"><f:setPropertyActionListener value="redmond" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Smoothness" ajax="false"><f:setPropertyActionListener value="smoothness" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="South-Street" ajax="false"><f:setPropertyActionListener value="south-street" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Start" ajax="false"><f:setPropertyActionListener value="start" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Sunny" ajax="false"><f:setPropertyActionListener value="sunny" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Swanky-Purse" ajax="false"><f:setPropertyActionListener value="swanky-purse" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Trontastic" ajax="false"><f:setPropertyActionListener value="trontastic" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="UI-Lightness" ajax="false"><f:setPropertyActionListener value="ui-lightness" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="UI-Darkness" ajax="false"><f:setPropertyActionListener value="ui-darkness" target="#{guestPreferences.theme}" /></p:menuitem>
                                <p:menuitem value="Vader" ajax="false"><f:setPropertyActionListener value="vader" target="#{guestPreferences.theme}" /></p:menuitem>
                            </p:submenu>
                        </p:menu>
                    </h:form>
                </p:layoutUnit>


                <p:layoutUnit position="center">
                    <ui:insert name="content"></ui:insert>
                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>

</html>
